home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / a_man / cat7 / tps.z / tps
Encoding:
Text File  |  2002-10-03  |  25.3 KB  |  529 lines

  1.  
  2.  
  3.  
  4. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      tps, tpsc - SCSI tape interface
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ////ddddeeeevvvv////rrrrmmmmtttt////ttttppppssss****
  13.      ////ddddeeeevvvv////rrrrmmmmtttt////****////lllluuuunnnn****////cccc****pppp****
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      Silicon Graphics systems support the Small Computer System Interface
  17.      (SCSI) for various tape drives, including QIC24 and QIC150 1/4"
  18.      cartridges, 9-track, 8 mm video, Ampex DIS/DST series, DLT (digital
  19.      linear tape), IBM 3590 and 3570, STK 9490 and 9840, STK SD3, Sony GY-10
  20.      and GY-2120, and DAT (digital audio tape) tape drives.  Not all systems
  21.      support all tape drives.  Since so many different types of devices are
  22.      supported, and not all their features can be determined directly from the
  23.      drive, a configuration table defines their capabilities.  This is usually
  24.      found in the file /_v_a_r/_s_y_s_g_e_n/_m_a_s_t_e_r._d/_s_c_s_i.
  25.  
  26.      The special files are named according to this convention:
  27.  
  28.      PPPPaaaarrrraaaalllllllleeeellll SSSSCCCCSSSSIIII aaaannnndddd FFFFCCCC----AAAALLLL
  29.  
  30.           ////ddddeeeevvvv////{rrrr}mmmmtttt////ttttppppssss_c_o_n_t_r_o_l_l_e_rdddd_I_D{nnnnrrrr}{nnnnssss}{ssss}{vvvv}{...._d_e_n_s_i_t_y}{cccc}
  31.  
  32.  
  33.      FFFFiiiibbbbrrrreeee CCCChhhhaaaannnnnnnneeeellll FFFFaaaabbbbrrrriiiicccc
  34.  
  35.           ////ddddeeeevvvv////{rrrr}mmmmtttt////_n_o_d_e_n_a_m_e////lllluuuunnnn_l_u_n{nnnnrrrr}{nnnnssss}{ssss}{vvvv}{...._d_e_n_s_i_t_y}{cccc}////cccc_c_o_n_t_r_o_l_l_e_rpppp_p_o_r_t
  36.  
  37.                Note that the Fabric device names always specify the _l_u_n, even
  38.                if it is zero.
  39.                _c_o_n_t_r_o_l_l_e_r is the SCSI controller number and _I_D is variously
  40.                known as the SCSI ID, the SCSI address, the drive address, and the unit number.
  41.                The _n_o_d_e_n_a_m_e and _p_o_r_t are used to indicate the Fibre Channel
  42.                world wide name (WWN) and the device port number. A Fibre Channel Fabric
  43.                device may have multiple special filenames. If the _n_o_d_e_n_a_m_e and
  44.                _l_u_n of different filenames are the same, respectively, these
  45.                filenames represent the same physical device. Care should be taken not
  46.                to use the same device at the same time by unintentionally opening
  47.                different filenames of the same device.
  48.  
  49.                The device types are:
  50.  
  51.                {nnnnrrrr}         no-rewind on close device
  52.  
  53.                {nnnnssss}         non-byte swapping device
  54.  
  55.                {ssss}          byte swapping device
  56.  
  57.                {vvvv}          variable block size device. This feature is present on most current
  58.                             generation tape drives, including those from STK, IBM, Sony, Quantum
  59.                             and others.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  71.  
  72.  
  73.  
  74.                {ssssttttaaaatttt}       a special purpose device;
  75.                             it can be used even when
  76.                             one of the other names for the same physical device is already
  77.                             opened (see below)
  78.  
  79.                {...._d_e_n_s_i_t_y}   for 9-track tape it is one of 800, 1600,
  80.                             3200, or 6250; for the Exabyte 8500 it is one of 8200 and 8500;
  81.                             for DLT7000 it is one of 4000 and 7000
  82.  
  83.                {cccc}          data compression is supported for Archive Python 01931 DDS-2 DAT,
  84.                             Sony SDT-9000 DDS-3 DAT, the various DLTs, IBM Magstar 3590
  85.                             and IBM Magstar MP 3570, EXABYTE 8900, STK 9490 and 9840,
  86.                             STK SD3, Sony GY-2120,
  87.                             and Fujitsu M1016/M1017 3480 devices as shipped.
  88.                             Compression is not
  89.                             the same as density and should not be confused
  90.                             with density. The degree to which compression increases capacity is
  91.                             data dependent.
  92.  
  93.                These special devices are accessible by only one program
  94.                at a time, except for the {ssssttttaaaatttt} device.
  95.                Opens on the {ssssttttaaaatttt} device
  96.                can block for several seconds, if another name for the same devices
  97.                is being opened or closed at the same time.
  98.                Similarly, the
  99.                MTIOCGET
  100.                ioctl on the {ssssttttaaaatttt} device can block if long operations are in progress via
  101.                one of the other names for the same device.
  102.  
  103.                The only operation the {ssssttttaaaatttt} device supports is the
  104.                MTIOCGET
  105.                ioctl, open, and close; all other attempted operations cause the EINVAL
  106.                errno to be returned.
  107.                It never causes any tape movement of any
  108.                kind (in particular, it never tries to load the tape, even if
  109.                media is present).
  110.  
  111.                Typically, if this tape drive is used as the system tape drive,
  112.                the device-specific names described above are
  113.                linked to user-friendly names in the /_d_e_v directory.
  114.                See
  115.                NNNNOOOOTTTTEEEESSSS
  116.                below and
  117.                _m_t_i_o(7)
  118.                for a description of the user-friendly names.
  119.  
  120. SSSSPPPPEEEECCCCIIIIAAAALLLL FFFFEEEEAAAATTTTUUUURRRREEEESSSS
  121.      The different devices support a multitude of capabilities.  In
  122.      particular, some support multiple densities, some support fixed block
  123.      size only, many support variable block sizes, some support multiple
  124.      speeds, some support direct transfer of audio data over the SCSI bus.
  125.      Most of these features are selected by which minor device is opened, and
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  137.  
  138.  
  139.  
  140.      others must be set via ioctl commands.  The list of capabilities that a
  141.      particular drive supports is set by the MMMMTTTTCCCCAAAANNNN____**** bits set in the
  142.      _m_a_s_t_e_r._d/_s_c_s_i file for that drive.  When a capability required for an
  143.      operation is not set, the EINVAL error code is returned for the request.
  144.  
  145.      In particular, in audio mode the variable block size device must always
  146.      be used for I/O, and parameters such as the recording frequency, program
  147.      number, and so on are all part of the data stream.  Additionally, when in
  148.      audio mode the rewind and seek commands return immediately.  If the drive
  149.      is closed in this state, subsequent opens block until they are completed.
  150.      If the drive remains open, certain commands, such as MTIOCGET and
  151.      MTIOCAUDPOSN, can be used to determine the current position of the tape
  152.      during the seek or rewind operation; the third argument is a pointer to a
  153.      struct mtaudio.  The MTAUD tape op is used to enable and disable audio
  154.      mode.  The third argument is 0 to use data mode and 1 to use audio mode.
  155.  
  156.      Many of the features that require ioctls can be set or changed via the
  157.      _m_t(1) command.
  158.  
  159.      The data structures and values for these ioctls can be found in the
  160.      include file /_u_s_r/_i_n_c_l_u_d_e/_s_y_s/_m_t_i_o._h, which is shipped with all systems.
  161.      There are extensive comments in this file, and at this time no attempt
  162.      has been made to document most of them here or in the _m_t_i_o(7) reference
  163.      page.
  164.  
  165.      However, there are a few surprising return values that are mentioned
  166.      here.  In particular, when using partitioned tapes (see mmmmtttt sssseeeettttppppaaaarrrrtttt, or
  167.      the MTSETPART ioctl), partition 0 is the 'main' partition, which is the
  168.      final part of the tape, and partition 1 is the partition closest to BOT.
  169.      Partitioned tapes are intended primarily so that a tape directory can be
  170.      written at the beginning of the tape, without any worry of overwriting
  171.      the data portion of the tape.  In addition, partitioned tapes indicate
  172.      BOT (EOT) when at beginning (end) of partition, rather than the 'real'
  173.      BOT (EOT).
  174.  
  175.      Some devices support overwrite at arbitrary tape positions, while others
  176.      require that the tape be at BOT or EOD (end of data).  Others allow
  177.      overwrite at any filemark (that is, 8mm from the BOT side of any
  178.      filemark).  Some experimentation may be necessary to decide what your
  179.      particular drive supports; all drives support at a minimum writing at
  180.      both BOT and EOD, assuming the media isn't write protected.
  181.  
  182. TTTTAAAAPPPPEEEE MMMMOOOOVVVVEEEEMMMMEEEENNNNTTTT CCCCRRRRIIIITTTTEEEERRRRIIIIAAAA
  183.      The only time the driver ever moves a tape is when told to, with the
  184.      exceptions listed below.  A command that causes tape movement is always
  185.      issued, assuming that it is a valid command and the media is loaded.
  186.  
  187.      A significant change from IRIX releases prior to 4.0 is that the driver
  188.      does NOT automatically position to the next filemark on the first command
  189.      that does I/O to the tape.  This means that mmmmtttt bbbbssssrrrr, and mmmmtttt ffffssssrrrr now have
  190.      meaning since the tape is in fact left where it is positioned.  It is now
  191.      the programmer's or user's responsibility to ensure that the tape is in a
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  203.  
  204.  
  205.  
  206.      valid state for I/O.  The drive or driver still detects and prevents
  207.      operations not valid for the current tape position, returning an
  208.      appropriate error in _e_r_r_n_o.
  209.  
  210.           1.  If the first read after an open encounters a filemark before
  211.               transferring any data and the tape was not known to be at the
  212.               top of a filemark or BOT, the filemark is skipped and the read
  213.               retried.  Any further errors are reported exactly as they occur.
  214.               In particular, if two sequential filemarks are found, the tape
  215.               is positioned between them.
  216.  
  217.           2.  If a read command encounters a filemark, that read returns a
  218.               short count (if any data was read) or 0.  If a short count is
  219.               returned, the next read returns 0, allowing detection of
  220.               filemarks.  An MTFSF ioctl should not be done at this point, as
  221.               the tape drive itself has already passed over the filemark.  If
  222.               an MTFSF is done at this point, the count should be decremented
  223.               by one.  The driver attempts to deal with this case, but can not
  224.               always do so, due to differences in drive firmware.
  225.  
  226.               The read following the read that returns 0 returns the data in
  227.               the next tape file, if any.  Note that this is a change from
  228.               earlier IRIX releases, which required an explicit MTFSF or other
  229.               tape ioctl to move the tape before further reads could be done.
  230.               The new behavior is consistent with most actual tape drives and
  231.               tape drivers in most BSD-derived UNIX systems.  Similarly, if an
  232.               MTFSR ioctl encounters a filemark, it stops at the filemark and
  233.               subsequent reads return data from the next tapefile, if any.
  234.  
  235.           3.  If early warning is encountered on a write or write filemark,
  236.               the driver does not allow further writes or write filemarks,
  237.               unless the MTANSI ioctl is issued.  Any data remaining is
  238.               flushed to tape, if possible.  For the QIC tape drives and the
  239.               8mm drives, an error is returned on both read and write unless
  240.               all the data was transferred when early warning is encountered.
  241.               This is so that older multi-volume backups continue to work and
  242.               new ones can be read on older releases.  All newer drives (9
  243.               track, DAT, and future drive types) return a short count if not
  244.               all the data could be transferred.  Requests other than read or
  245.               write are sent to the tape drive as usual.
  246.  
  247.           4.  On close, if the last tape movement operation was a successful
  248.               write (not a write filemark), the following happens:
  249.  
  250.               a)  Half-inch tape drives write two filemarks and then backspace
  251.                   one file, so that the tape is positioned between the two
  252.                   filemarks just written.  If, however, the tape is not in
  253.                   ansi mode and early warning has been encountered, no write
  254.                   filemark or backspace is done; filemarks are never written
  255.                   in audio mode.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  269.  
  270.  
  271.  
  272.               b)  Other tape drives write one filemark.  No backspace is done.
  273.  
  274.           5.  On the first status request or request that does tape motion
  275.               after a system boot, a SCSI bus reset, or a tape cartridge
  276.               insertion, the tape is rewound and loaded; this occurs even for
  277.               the norewind devices.  [Note: This can be suppressed via
  278.               master.d/scsi changes (e.g. Ampex drives)].  In addition, most
  279.               drives rewind a tape when it is ejected.  This means that if you
  280.               wish to append a new dataset to a tape that already contains
  281.               datasets, you should always issue the mmmmtttt ffffeeeeoooommmm command AFTER
  282.               loading the tape, just prior to using the program that will
  283.               append to the tape.  Do not count on a tape remaining at EOD,
  284.               just because that is where it was before it was removed.
  285.  
  286.           For devices that support it, the prevent media removal command is
  287.           sent to the drive on open and released on close, so that eject
  288.           buttons (when present) are disabled.
  289.  
  290. EEEERRRRRRRROOOORRRR RRRREEEETTTTUUUURRRRNNNNSSSS
  291.      The following errors are returned by this driver; other errors can also
  292.      be returned by higher levels of the operating system.
  293.  
  294.      EAGAIN    The drive returned an error indicating it was not ready (tape
  295.                ejected, drive taken offline, and so on).
  296.  
  297.      EBUSY     Returned on opens when the drive has already been opened.
  298.  
  299.      EFAULT    A bad address was passed in a call that required a data
  300.                transfer.
  301.  
  302.      EINVAL    This is returned for requests that are invalid for one reason
  303.                or another including:
  304.  
  305.                +o  Attempting to write or write file-mark after reading (except
  306.                   in audio mode, for devices that support it) without an
  307.                   intervening close, or ioctl to re-position the tape.
  308.  
  309.                +o  Attempting to read after writing (same exceptions as for
  310.                   writing).
  311.  
  312.                +o  Using an invalid count on read, write, write file-mark, and
  313.                   so on.
  314.  
  315.                +o  Attempting to do MTAFILE on a drive that doesn't support it
  316.                   (the MTCAN_APPEND bit is not set in the _m_a_s_t_e_r._d/_s_c_s_i file).
  317.  
  318.                +o  Attempting to do an ioctl on a drive that doesn't support it
  319.                   (such as MTBSR on Cipher 540S) or attempting to do an
  320.                   unsupported MTOP operation or other unsupported ioctl's.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  335.  
  336.  
  337.  
  338.                +o  Attempting to write to a QIC24 cartridge from a QIC150 drive
  339.                   (an MTIOCGET should be done, and the *QIC* bits should be
  340.                   checked for in mt_dposn to confirm this error).
  341.  
  342.                +o  Attempting to do something when not at BOT that can only be
  343.                   done at BOT, such as writing or reading a Kennedy tape drive
  344.                   at a different speed than was previously used or switching
  345.                   from the variable block size device to the fixed block size
  346.                   device.  (In IRIX 4.0, an attempt to use a different density
  347.                   is allowed, but the drive continues to use the original
  348.                   density.)
  349.  
  350.                +o  Attempting to perform reads, writes, or ioctls other than
  351.                   MTIOCGET on the {ssssttttaaaatttt} device.
  352.  
  353.      EIO       A generic error occurred, such as a SCSI bus reset,
  354.                unrecoverable media error, and so on.  Also occurs on close or
  355.                read/write if the media has been unloaded while the device is
  356.                open.
  357.  
  358.      ENOMEM    An attempt was made to read data with a count less than that at
  359.                which the block was written.  This can only happen with drives
  360.                that support variable block sizes.  It can also occur if the
  361.                kernel memory allocator is not able to allocate memory for the
  362.                driver structures, or the request exceeds maxdmasize for the
  363.                system.
  364.  
  365.      ENOSPC    Occurs on read or space commands that encounter end of tape or
  366.                end of data, on writes that are attempted at end of tape, and
  367.                also on some other commands that encounter EOT or EOD.
  368.  
  369.      EROFS     A write or write file-mark was attempted to a write-protected
  370.                tape.
  371.  
  372.      ENODEV    An open was attempted on a device with an invalid SCSI
  373.                controller or SCSI ID specified (that is, a mknod with the
  374.                wrong arguments was used to create the device special file) or
  375.                an attempt to open a tape in variable blocksize mode when the
  376.                device doesn't support it.  Also occurs when the SCSI inquiry
  377.                command fails or returns indicating that the device is not a
  378.                tape device (media not removable, or not a sequential access
  379.                device).
  380.  
  381. NNNNOOOOTTTTEEEESSSS
  382.      High density tape cartridges such as the DC6150 (originally called 600
  383.      XTD) written on a system equipped with QIC 150 tape drives can NOT be
  384.      read on older systems.  Even if a low density tape (such as DC 600A) is
  385.      used, it is still written at a higher density (QIC 120) than older tape
  386.      drives can read.  Tapes written on the older systems can still be read on
  387.      the new tape drives, however.  Systems with QIC 150 cartridge tape drives
  388.      such as the Personal IRIS are able to read QIC24 tapes (310 oersted) such
  389.      as the DC 300XL, but are not able to write them.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  401.  
  402.  
  403.  
  404.      All tape devices other than the QIC (quarter-inch) tape drives have
  405.      /_d_e_v/_t_a_p_e linked to the {nnnnssss} device for performance, since there is no
  406.      compatibility issue, and byte swapping is done in software.  Most newer
  407.      drives support variable block size devices, and the /_d_e_v/_t_a_p_e link uses
  408.      those by default; when multiple densities are supported, as with 9-track,
  409.      the link is to the highest capacity device.  For compatibility with
  410.      earlier IRIX releases, the 8mm device is linked to the fixed block
  411.      device.  See the (unfortunately somewhat confusing) script /_d_e_v/_M_A_K_E_D_E_V
  412.      for details; in particular, look at the ttttaaaappppeeeelllliiiinnnnkkkkssss target.
  413.  
  414.      Each time the tape drive is closed and the drive has reported recovered
  415.      error, the driver reports to the console and (as normally configured) to
  416.      /_v_a_r/_a_d_m/_S_Y_S_L_O_G the number of recovered errors, if any.  A small number
  417.      is not indicative of problems, but a large number (somewhere above about
  418.      2-5% errors as a percentage of I/Os, depending on media age and quality)
  419.      probably indicates that the media is approaching the end of its lifetime,
  420.      that the drive read/write heads are dirty, or that the heads need to be
  421.      realigned.  A typical recovered error message might look like:
  422.  
  423.           NOTICE: tps0d7 had 8 successfully retried commands (1% of r/w)
  424.  
  425.      The first number is the controller number, the second is the SCSI ID on
  426.      that controller.
  427.  
  428.      It is important to realize that these are _r_e_c_o_v_e_r_e_d errors (at the drive
  429.      level) and therefore do not result in errors being reported to the
  430.      program doing the tape I/O.
  431.  
  432.      It should be noted that the reported percentage of retried errors for
  433.      some devices, most notably EXABYTE, may be shown to be orders of
  434.      magnitude larger than the actual number of I/Os. This is not necessarily
  435.      indicative of a serious problem when one realizes how this value is
  436.      derived. The EXABYTE 8505, for example, when returning the number of
  437.      retried I/Os will report the number of retried 1Kbyte blocks, and hence
  438.      an alarmingly large reported percentage of retried errors.
  439.  
  440.      With more recent versions of microcode, the Ampex DIS/DST series of
  441.      drives support variable length blocks. These should be detected as such
  442.      and the appropriate device names created. It is important to note that
  443.      even though variable blocks are supported, blocks smaller than 1,199,840
  444.      bytes will reduce cartridge capacity and throughput.
  445.  
  446.      Nine track tape users wishing to read large blocks (i.e. "gapless") tapes
  447.      should obtain their drive from the M4 Data Corporation in Florida. They
  448.      should request the "SGI Long Block" feature to insure that the proper
  449.      microcode is installed in the 9914 drive. These drives will identify
  450.      themselves as "SGI" for the vendor and "GOLD SEAL" for the model.  The
  451.      default master.d/scsi supplied by SGI includes a definition for this
  452.      drive.  It is also important to check that maxdmasize is set correctly
  453.      for the system.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. ttttppppssss((((7777MMMM))))                                                                ttttppppssss((((7777MMMM))))
  467.  
  468.  
  469.  
  470. FFFFIIIILLLLEEEESSSS
  471.      /dev/rmt/tps*
  472.      /dev/rmt/*/lun*/c*p*
  473.      /dev/mt         exists as a symlink to /_d_e_v/_r_m_t; the use of the /_d_e_v/_m_t
  474.                      pathname is deprecated and is supported only for
  475.                      compatibility
  476.      /dev/tape, /dev/nrtape, /dev/tapens, /dev/nrtapens
  477.                      convenience links to the "preferred" device in /_d_e_v/_r_m_t
  478.                      (highest SCSI ID on lowest numbered SCSI bus, for tps
  479.                      devices only)
  480.      /var/sysgen/master.d/scsi
  481.                      contains a configuration table indicating what devices
  482.                      support what features and what string should be matched
  483.                      against the string returned by the SCSI inquiry command
  484.                      and the _h_i_n_v(1M) command; this was formerly in
  485.                      _m_a_s_t_e_r._d/_t_p_s_c
  486.      /dev/MAKEDEV    a makefile (normally invoked by the superuser in the /_d_e_v
  487.                      directory only) that creates devices that match the
  488.                      installed tape drives if invoked as ccccdddd ////ddddeeeevvvv;;;; ....////MMMMAAAAKKKKEEEEDDDDEEEEVVVV
  489.                      ttttaaaappppeeee
  490. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  491.      MAKEDEV(1M), bru(1), cpio(1), hinv(1M), mt(1), tar(1), ioctl(2),
  492.      rmtops(3), datframe(4), mtio(7).
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.